package com.example.online_exam_system.utils;

import com.google.code.kaptcha.Constants;

import javax.servlet.http.HttpServletRequest;

/**
 * @Classname:KaptchaValid
 * @program:online-exam_-springboot
 * @author:ZiXuan
 * @crate:2021-11-04-14-42
 **/
public class KaptchaValid {
    public static  boolean isRelsase(HttpServletRequest request,String kapText){
        if(!request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY).equals(kapText)){
            System.out.println("生成的验证码:"+request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY));
            return false;
        }
        return true;
    }
}
